<template>
    <div id="" class="tem">
      <div class="df"><!-- -->
        <h3>{{userName.name}} 欢迎使用车辆管理系统！</h3>
        <div class="router" :class="this.ta != 0?Classn:''" >
          <router-link to="/use_control/add_vehicle">添加车辆</router-link>
          <router-link to="/use_control/userinfo">完善个人信息得优惠</router-link>
        </div>
        <div class="router"  :class="this.ta != 1?Classn:''" >
          <router-link to="/use_control/add_vehicle">用户信息</router-link>
          <router-link to="/use_control/userinfo">车辆信息</router-link>
        </div>
      </div>

    </div>
</template>

<script>
  //数据异常提示
  import { Toast } from 'mint-ui';
    export default {
        name: "homepage",
     props:['userName'],
      data(){
          return{
            name:'',
            ta:'',
            Classn:'blacx'
          }
      },
      created(){
      },
      mounted(){
        this.getname();
      },
      methods:{
          //请求用户名
        getname:function () {
          this.name = this.userName.name;
          if(this.name == "系统用户"){
            this.ta = 1;
          }else{
            this.ta = 0;
          }
        }
      }
    }
</script>

<style scoped>
  .tem{width: 100%}
  .df{width: 70%;margin: 0 auto;text-align: left}
    h3{margin: 100px auto 0;}
  .router{
    display: none;
    margin: 20px auto;
    font-size: 16px;
    text-align: left;
  }
  .blacx{display: block}

</style>
